<template>
	<u-navbar :back-icon-color='color' :is-back="true" :immersive="true" :background="{
		background: 'none'
	}" :border-bottom="false">
		<view class="slot-wrap">
			<image v-if="dianzan==1" @click="submit(1)" style="position: absolute;
			right: 100rpx;
			bottom: 15rpx;
			width: 44rpx;
			height: 44rpx;" src="@/static/img/213sc.png" />
			<image v-if="dianzan==0" @click="submit(1)" style="position: absolute;
			
	right: 100rpx;
	bottom: 15rpx;
	width: 44rpx;
	height: 44rpx;" src="@/static/img/7wdpkD.png" mode="" />
			<image @click="submit(2)" style="	position: absolute;
			 right: 30rpx;
			 bottom: 15rpx;
			 width: 44rpx;
			 height: 44rpx;" class="fx" src="@/static/img/7wdipd.png" mode="" />
		</view>
	</u-navbar>
</template>

<script>
	export default {
		props: {
			data: {
				type: Object,
				default: {},
			},
			dianzan: {
				type: Number,
				default: 0,
			},
			color: {
				type: String,
				default: '#fff',
			},
			type: {
				type: Boolean,
				default: true,

			}
		},
		data() {
			return {

			};
		},
		methods: {
			submit(a) {
				if(a==1){
					this.$api('broadcast/collection', this.data).then(res => {
						if (res.code == 1) {
							this.$toast(res.msg, 1)
							setTimeout(() => {
								this.$emit("ontap", a)
							}, 500)
					
						} else {
							this.$toast(res.msg, 0)
						}
					})
				}
			
			},
			go() {
				uni.navigateBack({
					delta: 1
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.tab {
		display: flex;
		justify-content: space-between
	}
</style>
